package ch3;

import java.io.Serializable;

public class Student implements Serializable {

	/**
	 * iiop corba
	 */
	private static final long serialVersionUID = 1L;
	private String name;
	private Sex sex;
	// 序列化时候忽略
	private transient int age = 20;

	public Student() {
	}

	public Student(String name, Sex sex) {
		super();
		this.name = name;
		this.sex = sex;
	}

	public Student(String name, Sex sex, int a) {
		super();
		this.name = name;
		this.sex = sex;
		this.age = a;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public Sex getSex() {
		return sex;
	}

	public void setSex(Sex s) {
		this.sex = s;
	}

	@Override
	public String toString() {
		return "Student [name=" + name + ", sex=" + sex + ",age=" + age + "]";
	}

}
